﻿
using EbbinghausWord.BLL;

namespace EbbinghausWord.Entities
{
    /// <summary>
    /// 书籍实体类
    /// </summary>
    public class BookEntity
    {
        /// <summary>
        /// 书籍Id
        /// </summary>
        public int BookId { get; set; }

        /// <summary>
        /// 书籍名称
        /// </summary>
        public string BookName { get; set; }

        /// <summary>
        /// 单词数
        /// </summary>
        public int WordCount { get; set; }

        /// <summary>
        /// 正在学习中的单词数
        /// </summary>
        public int LearningWordCount { get; set; }

        /// <summary>
        /// 学会的单词数
        /// </summary>
        public int LearnedWordCount { get; set; }

        #region VM
        /// <summary>
        /// 是否开启按钮
        /// </summary>
        public bool IsEnabledButton
        {
            get { return new UserConfig().UserBookId != BookId; }
        }

        public string IconPath
        {
            get
            {
                return new UserConfig().UserBookId != BookId
                   ? @"/Images\book-library.png"
                           : @"/Images\voice-check.png";
            }
        }

        /// <summary>
        /// 显示的汇总信息
        /// </summary>
        public string TotalMessage
        {
            get { return string.Format("共 {0} ，正在学习 {1}， 已学会 {2}", WordCount, LearningWordCount, LearnedWordCount); }
        }
        #endregion
    }
}
